import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    scrollIndex: -1,
    langChange:false
  },
  mutations: {
    changeScrollIndex (state,num) {
      state.scrollIndex = num || 0
    },
    changeLang (state) {
      state.langChange = !state.langChange
    }
  },
  actions: {
    changeScrollIndex (context,num) {
      context.commit('changeScrollIndex',num)
    }
  }
})

export default store